package com.question.business.user.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户
 * </p>
 *
 * @author star
 * @since 2022-07-20
 */
@Getter
@Setter
@TableName("t_user")
public class User {

    /**
     * ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 用户名
     */
    private String username;

    /**
     * 昵称
     */
    private String nickName;

    /**
     * 直属上级
     */
    private String parentId;
    
    /**
     * 密码
     */
    private String password;

    /**
     * 联系人
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String contact;

    /**
     * 联系电话
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String phone;

    /**
     * 省
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String province;

    /**
     * 市
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String city;

    /**
     * 区
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String district;

    /**
     * 邮箱
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String email;

    /**
     * 密码到期日
     */
    private LocalDate expire;

    /**
     * 账号到期日
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private LocalDate dueDate;

    /**
     * 登录错误次数
     */
    private Integer errorNumber;

    /**
     * 最近一次登录时间
     */
    private LocalDateTime lastLoginTime;

    /**
     * 启用状态(1:启用2:停用)
     */
    private Integer enabled;

    /**
     * 是否删除(0:未删除1:已删除)
     */
    @TableLogic
    private Integer isDeleted;

    /**
     * 创建时间
     */
    private LocalDateTime createdTime;

    /**
     * 创建用户
     */
    @TableField(fill = FieldFill.INSERT)
    private String createdUser;


    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updatedTime;

    /**
     * 更新用户
     */
    @TableField(fill = FieldFill.UPDATE)
    private String updatedUser;

}